#include <ciallo_imgui/demo_window.h>
#include <ciallo_imgui/image.h>
#include <ciallo_imgui/scope.h>
#include <imgui/imgui.h>

void ciallo::show_background_window(ciallo::Texture &texture) {
    ImGuiWindowFlags _flags =
        ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoScrollWithMouse |
        ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBringToFrontOnFocus;
    const ImGuiViewport *viewport = ImGui::GetMainViewport();
    ImGui::SetNextWindowPos(viewport->Pos);
    ImGui::SetNextWindowSize(viewport->Size);

    ciallo::WindowScope("back_ground", _flags)
        << [&]() { ImGui::Image(texture.get_handle(), viewport->Size); };
}